<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        function Person(name,age,skill,gender)
        {
            this.name=name;
            this.age=age;
            this.skill=skill;
            this.gender=gender;
        }
        var person1=new Person("Lilith",12000,"A.T.Field","Angel");
        var person2=new Person("Adam",12000,"A.T.Field","Angel");
        console.log(person1);
        console.log(person2);

        function Student(name,age,skill)
        {
            this.name=name;
            this.age=age;
            this.skill=skill;
        }
        var student1=new Student("White",18,"Bomb");
        var student2=new Student("Black",18,"Laser");
        console.log(student1);
        console.log(student2);
    </script>
</head>
<body>
    <!--
        方式四：自定义构造函数模式
        套路：自定义构造函数，通过new创建对象
        适用场景：需要创建多个类型确定的对象
        问题：每个对象都有相同的数据，浪费内存
    -->
</body>
</html>